import request from '@/utils/request'

// 查询柜机管理列表
export function listMachine(query) {
  return request({
    url: '/machine/machine/list',
    method: 'get',
    params: query
  })
}

// 查询柜机管理详细
export function getMachine(id) {
  return request({
    url: '/machine/machine/' + id,
    method: 'get'
  })
}

// 新增柜机管理
export function addMachine(data) {
  return request({
    url: '/machine/machine',
    method: 'post',
    data: data
  })
}

export function save(data) {
  return request({
    url: '/machine/machine/save',
    method: 'post',
    data: data
  })
}

// 修改柜机管理
export function updateMachine(data) {
  return request({
    url: '/machine/machine',
    method: 'put',
    data: data
  })
}
// 箱格条件展示
export function getBoxList(data) {
  return request({
    url: '/machine/machine/getBoxList',
    method: 'put',
    data: data
  })
}

// 删除柜机管理
export function delMachine(id) {
  return request({
    url: '/machine/machine/' + id,
    method: 'delete'
  })
}

export function findMachineById(id){
  return request({
    url: '/machine/machine/findMachineById/'+ id,
    method: 'get',
  })
}

export function findBoxById(id){
  return request({
    url: '/machine/machine/findBoxById/'+ id,
    method: 'get',
  })
}

export function findBoxRecordList(data){
  return request({
    url: '/machine/machine/findBoxRecordList/',
    method: 'get',
    params: data,
  })
}


export function updateBox(data){
  return request({
    url: '/machine/machine/updateBox/',
    method: 'post',
    data: data,
  })
}


export function updateStatus(data){
  return request({
    url: '/machine/machine/updateStatus/',
    method: 'post',
    data: data,
  })
}

export function findMachineByIdqq(id){
  return request({
    url: '/machine/machine/findMachineByIdqq/'+ id,
    method: 'get',
  })
}
